-- 复数加减

local _M = {}

function _M.new(r, i)
	return {r = r, i = i}
end

function _M.add(c1, c2)
	return _M.new( c1.r + c2.r, c1.i + c1.i )
end

function _M.sub(c1, c2)
	c1.r -= c2.r
	c1.i -= c1.i
	return c1
end

return _M